package com.example.springboot_study.jpa.primary;

import com.example.springboot_study.entity.primary.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * @author : liqun
 * @createTime : 2021/9/21 13:38
 */
public interface TestRepository extends JpaRepository<User,Long> {
    User findByName(String name);

    User findByNameAndAge(String name, Integer age);

    @Query("from User u where u.name=:name")
    User findUser(@Param("name") String name);
}
